# !/usr/bin/python3
# -*- coding:utf-8 -*-
"""
@author: JHC000abc@gmail.com
@file: routes_base.py
@time: 2024/11/5 20:18 
@desc: 

"""

from flask import Blueprint, request, send_file, render_template



base_bp = Blueprint('base', __name__)


@base_bp.route('/', methods=['GET'])
def index():
    """

    :return:
    """
    return render_template('index.html')


@base_bp.route('/home', methods=['GET'])
def home():
    print(request.cookies)
    return render_template('home.html')




@base_bp.route('/download', methods=['GET'])
def download_file():
    """

    :return:
    """
    filename = request.args.get("filename")
    return send_file(filename, as_attachment=True)
